home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / gamesrc / mancala / mancala.h < prev    next >
C/C++ Source or Header  |  1994-08-24  |  891b  |  37 lines

  1. typedef struct  m_pos_struct  {
  2.     int  moves[200];
  3.     int  nmoves;
  4.     int  player_to_move;
  5.     int  pits[14];
  6. } m_pos_t;
  7.  
  8.  
  9. typedef m_pos_t  ab_position_t;
  10.  
  11. typedef int  ab_score_t;
  12.  
  13. #define  AB_WIN_SCORE  (48*1024+1024)  /* Just a huge value. */
  14.  
  15. #define  AB_MAX_MOVES  6
  16.  
  17. typedef struct  ab_move_struct  {
  18.     int  pit;
  19.     int  score;
  20. } ab_move_t;
  21.  
  22. typedef struct  ab_storage_struct  {
  23.     int  old_tomove;
  24.     int  oldpits[14];
  25. } ab_storage_t;
  26.  
  27. #define  AB_MOVE_VAL(move)  ((move).score)
  28. #define  AB_PLAYER_TO_MOVE(pos)  ((pos).player_to_move)
  29.  
  30. extern int  ab_generate_moves(ab_position_t *pos, ab_move_t *moves);
  31. extern ab_score_t  ab_do_move(ab_position_t *pos, ab_move_t *move,
  32.                                                             ab_storage_t *storage);
  33. extern void  ab_undo_move(ab_position_t *pos, ab_storage_t *storage);
  34. extern int  ab_move_cmp(ab_move_t *mv1, ab_move_t *mv2);
  35.  
  36. extern ab_move_t  ab_search(ab_position_t *pos, int depth);
  37.